export const schema = {
    type: "page",
    title: "平台设置",
    body: [
        {
            type: "nav",
            stacked: false,
            links: [
                {
                    label: "编辑",
                    to: "/platform/edit/${id}"
                },
                {
                    label: "查看",
                    to: "/platform/view/${id}"
                },
                {
                    label: "设置",
                    to: "/platform/setting/${id}"
                },
            ]
        },

        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                panelClassName: 'no-border m-b-none',
                api: "post:/api/platform/${id}/settings",
                initApi: "get:/api/platform/${id}?_=${_}",
                // redirect: "/org/list",
                submitText: "",
                name: "theform",
                type: "form",
                title: "",
                actions: [
                    {
                        type: "submit",
                        primary: true,
                        label: "保存",
                        icon: "fa fa-save pull-left"
                    }
                ],
                collapsable: true,
                fieldSet: [
                    {
                        collapsed: false,
                        className: 'm-t',
                        title: '域名设置',
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: 'text',
                                name: 'prefix',
                                label: '域名前缀'
                            },
                            {
                                type: 'static-text',
                                name: 'platform_url',
                                visibleOn: 'data.platform_url',
                                label: '平台域名',
                                copyable: true
                            },
                        ]
                    },

                    {
                        title: '证书设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: "text",
                                name: "cert_title",
                                label: "证书标题"
                            },

                            {
                                type: "text",
                                name: "cert_platform",
                                label: "证书机构"
                            },

                            {
                                type: "image",
                                name: "cert_cachet",
                                label: "证书公章"
                            },

                            {
                                type: "text",
                                name: "cert_auth_platform",
                                label: "证书认证机构"
                            }
                        ]
                    },

                    {
                        title: '模块设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [

                            {
                                type: "module-settings",
                                name: "modules",
                                label: false,
                                className: 'm-t-md',
                                source: '/api/module/options?_=${_}',
                                required: true
                            }
                        ]
                    },

                    {
                        title: '机构设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [

                            {
                                type: "antd-transfer",
                                name: "org_list",
                                label: false,
                                className: 'm-t-md',
                                source: '/api/platform/${id}/org?_=${_}',
                                required: true
                            }
                        ]
                    },

                    {
                        title: '服务中心设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: "rich-text",
                                name: "platform_info",
                                label: '平台介绍'
                            },

                            {
                                type: "rich-text",
                                name: "platform_manual",
                                label: '使用帮助'
                            },

                            {
                                type: "rich-text",
                                name: "platform_service",
                                label: '客服中心'
                            },

                            {
                                type: 'text',
                                name: 'platform_service_tel',
                                label: '客服电话',
                                validations: 'isPhone'
                            },
                        ]
                    }
                ]
            }
        }
    ]
};
